-----------------------------------------------------------------------------------------------------------------------------------------
Part 2 - The powerful combination of WSH and ADSI under Windows 2000 (Scripts Kit)

Sample 01 - The Active Directory search function (ADSearchFunction.vbs)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)
	This script cannot be run without a main procedure calling this function.

Sample 02 - The main function calling the ADSearch function (TestADSearchFunction.vbs)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)

Sample 03 - Making an external VB Script function reusable with XML encapsulation (TestADSearchFunction.WSF)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)
	The Sample 01 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)

Sample 04 - The XML dummy file generated by the Wizard Script Component (ADSearch (Dummy).WSC)
	No particular action is required.	
	This script is a "dummy" sample. Nothing to execute.

Sample 05 - The ADSearch VB Script function exposed as a COM component (ADSearch.wsc)
	This Windows Script Component must be registered (See White Paper)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)
	This script cannot be run without a main procedure calling this Windows Script Component.

Sample 06 - Calling the ADSearch Windows Script Component from VB Script (TestADSearchWSC.vbs)
	The Sample 05 must be registered as a Windows Script Component.
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path in WSC module (Sample 05) must be adapted to 
						point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)

Sample 07 - Calling the ADSearch Windows Script Component from Java Script (TestADSearchWSC.js)
	The Sample 05 must be registered as a Windows Script Component.
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path in WSC module (Sample 05) must be adapted to 
						point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)

Sample 08 - Windows Script Component triggering event (ADSearch (with Event).wsc)
	This Windows Script Component must be registered (See White Paper)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)
	This script cannot be run without a main procedure calling this Windows Script Component.

Sample 09 - Windows Script File trapping event (TestADSearchWSC (with Event).vbs)
	The Sample 08 must be registered as a Windows Script Component.
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path in WSC module (Sample 08) must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)

Sample 10 - Loading the entire Active Directory Tree objects properties (With systemFlags) (ShowADTreeInXL (with System Flags).WSF)
	Excel 97 or Excel 2000 must be installed.
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)
	The Sample 01 must be present in the same directory as this script.
	(For Function reuse, see running condition of related sample)
	The Sample 11 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Include.Vbs available in the Functions folder must be present in the same directory as this script. (Function reuse)

Sample 11 - Prompting for some parameters (PromptParametersFunction.vbs)
	Can be run on a Windows 2000 Professional or Server.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
	This script cannot be run without a main procedure calling this function.

Sample 12 - Deciphering a security descriptor from the File System or from the Active Directory (ViewRightFunction.vbs)
	Should be run on a Windows 2000 Domain controller with ADsSecurity.DLL registered (RegSvr32.Exe ADsSecurity.DLL) 
	otherwise the LDAP path must be changed.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADsSecurity.DLL registered. (RegSvr32.Exe ADsSecurity.DLL)
	This script cannot be run without a main procedure calling this function.

	Warning:	There is also in this sample directory a sample called 'ViewRightFunction (with Mailbox SD).vbs'.
			This sample is basically the same as 'ViewRightFunction.vbs', the only difference in 
			'ViewRightFunction (with Mailbox SD).vbs' is a test on the Exchange 2000 Security Descriptor to check
			its presence. in case of a positive result, the Exchange 2000 Security Descriptor is also deciphered.
			The user must include in the main procedure wich sub function to use. (See Sample 13)

Sample 13 - Using the `ViewSecurityDescriptor.VBS' script from a Windows Script file (ViewRightDemo.WSF)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Security Descriptor)	
	The Sample 12 must be present in the same directory as this script.
	(For Function reuse, see running condition of related sample)
	The Include.Vbs available in the Functions folder must be present in the same directory as this script. (Function reuse)

Sample 14 - Adding rights to a File System object or to an Active Directory object (AddRightFunction.vbs)
	Should be run on a Windows 2000 Domain controller with ADsSecurity.DLL registered (RegSvr32.Exe ADsSecurity.DLL) 
	otherwise the LDAP path must be changed.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADsSecurity.DLL registered. (RegSvr32.Exe ADsSecurity.DLL)
	This script cannot be run without a main procedure calling this function.

Sample 15 - Removing rights from a File System object or from an Active Directory object (RemoveRightFunction.vbs)
	Should be run on a Windows 2000 Domain controller with ADsSecurity.DLL registered (RegSvr32.Exe ADsSecurity.DLL) 
	otherwise the LDAP path must be changed.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADsSecurity.DLL registered. (RegSvr32.Exe ADsSecurity.DLL)
	This script cannot be run without a main procedure calling this function.

Sample 16 - Windows Script demonstrating the miscellaneous right functions usage (SetRightDemo.WSF)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Security Descriptor)	
	The Sample 12 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 14 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 15 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Include.Vbs available in the Functions folder must be present in the same directory as this script. (Function reuse)

Sample 17 - Creating a security descriptor (SetSDFunction.vbs)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
	This script cannot be run without a main procedure calling this function.
	
Sample 18 - Creating groups for organizational unit members (UpdateGroupsFromOU.WSF)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
		                             The EnableE-MailFunction (ADSI).vbs (Sample 20) must be used.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)
	The Sample 01 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 11 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 19 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 20 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Include.Vbs available in the Functions folder must be present in the same directory as this script. (Function reuse)

Sample 19 - Checking the presence of Exchange 2000 with a specific Exchange Organization name (VerifyMSExchangeFunction.vbs)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	This script cannot be run without a main procedure calling this function.

Sample 20 - Enabling E-Mail on object for Exchange 2000 (EnableE-MailFunction (ADSI).vbs)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
	This script cannot be run without a main procedure calling this function.

Sample 21 - Enabling E-Mail on object for Exchange 2000 (EnableE-MailFunction (CDOEXM).vbs)
	Can be run under Windows 2000 if Exchange System Manager is installed.
	Cannot be run under Windows NT 4.0.
	This script cannot be run without a main procedure calling this function.

Sample 22 - Creating users under Windows 2000 with their associated Exchange 2000 mailboxes (PopulateUsers.WSF)
	Can be run under Windows 2000 without any special requirement.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
					     ADSI 2.5 modules installed.
					     Microsoft Data Access Components 2.1 must be installed.
					     The LDAP path must be adapted to point to a Windows 2000 Domain Controller.
   		                             The EnableE-MailFunction (ADSI).vbs (Sample 20) must be used.
	The current user security context is used to run this function. 
	(It means that current user must have enough rights to access Active Directory)
	The following constants must be adapted in the script to match your configuration settings:

	        Machine member of the Domain homing the user accounts:
		(The script prompts the user for the parameter)
	        Const cAccountComputer          = "MYW2KDC"

	        Machine running Microsoft Exchange 2000:
		(The script prompts the user for the parameter)
	        Const cExchangeComputer         = "W2K-DPEN6400DEV"

	        Organization parameters with specific Exchange 2000 Admin Group and Storage:
		(The script prompts the user for each parameter)
	        Const cExchangeOrganization     = "Home Business"
	        Const cExchangeAdminGroup       = "First Administrative Group"
	        Const cExchangeStorageGroup     = "First Storage Group"
                Const cExchangeMailboxStore     = "Mailbox Store (A)"

	        Misc. user settings for default assignements:
	        Const cLogonScript              = "LOGON_SCRIPT.CMD"
	        Const cDefaultPassword          = "password"
	        Const cHomeDrive                = "U:"

	        Misc. settings for Profile and Home Directory paths (Local and Remote via UNC)
	        Letter mapping used locally on the server having the homedirectories.
	        This is the local path base used on the server himself.
	        (From a local filesystem point of view)
	        Const cHomeDirLocalAccess       = "J:\I01\APPS\HOME\"

		The common share for home and profile directories:
	        Const cProfileShare             = "\Profile$\"
	        Const cHomeShare                = "\HOME$\"

	        Default Excel datasheet to use when nothing is given on the command line:
		(The script prompts the user for the path)
	        Const cXLDataSheetName          = "J:\I01\APPS\WSH\PopulateUsers.xls"

	The Sample 11 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 14 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 15 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 17 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 19 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 20 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 21 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 23 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Sample 24 must be present in the same directory as this script. 
	(For Function reuse, see running condition of related sample)
	The Include.Vbs available in the Functions folder must be present in the same directory as this script. (Function reuse)

	Warning: 
	The script creates the users in the default user container CN=Users. The associated mailbox is created in the 
	information store given as parameter.

Sample 23 - Creating the directories for the home directory and the profile directory (CreateFolderFunction.vbs)
	Can be run on a Windows 2000 Professional or Server.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
	This script cannot be run without a main procedure calling this function.

Sample 24 - Creating the share for the home directory (CreateShareFunction.vbs)
	Can be run on a Windows 2000 Professional or Server.
	Can be run under Windows NT 4.0 with WSH 2.0 modules installed.
	This script cannot be run without a main procedure calling this function.

Functions
	Contains all the functions presented in this White Paper (Reusable kit)

		ADSearchFunction.vbs (Sample 01)
		ViewRightFunction.vbs (Sample 12)
		RemoveRightFunction.vbs (Sample 15)
		AddRightFunction.vbs (Sample 14)
		PromptParametersFunction.vbs (Sample 11)
		EnableE-MailFunction (ADSI).vbs (Sample 20) or EnableE-MailFunction (CDOEXM).vbs (Sample 21)
		VerifyMSExchangeFunction.vbs (Sample 19)
		CreateShareFunction.vbs (Sample 24)
		CreateFolderFunction.vbs (Sample 23)
		Include.vbs 
		SetSDFunction.vbs (Sample 17) only if Sample 20 is used
		ViewRightFunction (with Mailbox SD).vbs	(Sample 12 bis)

Excel Data
	Contains a sample Excel data sheet for user creation in Sample 22

Module - ADsSecurity.DLL
	Module used by Sample 12, 14 and 15 to manipulate rights on the File System.
	(Coming from the ADSI 2.5 SDK)